import request from '@/utils/request'

export const artGetChannelsService = () => {
  return request.get('/my/cate/list')
}

export const artAddChannelService = (data) => {
  return request.post('/my/cate/add', data)
}

export const artUpdateChannelService = (data) => {
  return request.put('/my/cate/info', data)
}
export const artDeleteChannelService = (id) => {
  return request.delete('/my/cate/del', {
    params: {
      id
    }
  })
}

export const artGetArticleListService = (params) => {
  return request.get('/my/article/list', {
    params
  })
}

export const artAddArticleService = (data) => {
  return request.post('/my/article/add', data)
}

export const artDelArticleService = (id) => {
  return request.delete('/my/article/info', {
    params: { id }
  })
}
//获取文章详情
export const artGetArticleDetailService = (id) => {
  return request.get('/my/article/info', {
    params: {
      id
    }
  })
}

export const artUpdateArticleService = (data) => {
  return request.put('/my/article/info', data)
}
